<template>
     <view style="height: 100%;margin-top: 100rpx;">
		 <!-- #ifdef H5 -->
		     <!-- <view class="iconfont icon-xiangzuo" @click="goback()"></view> -->
		     <!-- #endif -->
		<hx-navbar  :back="true" :fixed="false" :color="knavTitleColor" barPlaceholder="hidden"
			 	transparent="auto"></hx-navbar>
		<web-view :src="walletUrl"  @message="onMessage" ></web-view>  
	</view>
</template>

<script>
	export default {
		data() {
			return {
				walletUrl: ""
			}
		},
		onLoad(val) {
			this.walletUrl = val.url
			var height = 0;
			uni.getSystemInfo({
				success: (sysinfo) => {
					height = sysinfo.windowHeight;
				},
				complete: () => {}
			});
			var currentWebview = this.$scope.$getAppWebview();
			setTimeout(function() {
				this.barHeight = plus.navigator.getStatusbarHeight();
				var wv = currentWebview.children()[0];
				wv.setStyle({
					top: this.barHeight,
					height: height - this.barHeight,
					scalable: true,
				})
			}, 500);
		},
		methods: {
			// 接收到消息以后返回首页
			onMessage (event) {
			  uni.switchTab({
				url:`/pages/index/index`
			  })
			  console.log("event--",event);
			  console.log('收到来自web-view的消息-------：', event)
			},
		}
	}
</script>

<style>

</style>